package com.pda.xinma.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.pda.xinma.R;
import com.pda.xinma.bean.BackDepotListBean;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;

import java.util.List;

public class BackDepotAdapter extends BaseAdapter<BackDepotListBean> {
    public BackDepotAdapter(int layoutResId, @Nullable List<BackDepotListBean> data) {
        super(layoutResId, data);
        addChildClickViewIds(R.id.tv_close);
    }

    @Override
    protected void convert(BaseViewHolder helper, BackDepotListBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_no,item.getEntryNo());
        helper.setText(R.id.tv_time,item.getCreateTime());
        helper.setText(R.id.tv_entryType,"类型："+item.getEntryTypeStr());
        helper.setText(R.id.tv_data1,"仓库："+item.getData1());
        helper.setText(R.id.tv_status,item.getEntryStatusStr());
        if (item.isShutDown()){
            helper.setVisible(R.id.tv_close, true);
        }else {
            helper.setVisible(R.id.tv_close, false);
        }
    }
}
